<!DOCTYPE html>
<html>
    <head>
        
    </head>
<script>
	var str = "Hello,JREDU杰瑞教育JREDU！";
var RegExp = new RegExp("JREDU","g");
var result;
while((result=RegExp.exec(str))!=null){
	console.log(result);
	console.log(RegExp.lastIndex);//打印结果11
}
	
	
</script>
</html>
